/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 赛博科技风格主容器 */
.cyber-dashboard {
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    color: #00ffea;
    font-family: 'Courier New', 'Monaco', monospace;
    position: relative;
    overflow-x: hidden;
    padding-bottom: 2rem;
}

/* 赛博网格背景 */
.cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
            linear-gradient(rgba(0, 255, 234, 0.1) 1px, transparent 1px),
            linear-gradient(90deg, rgba(0, 255, 234, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* 扫描线效果 */
.cyber-scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
            to bottom,
            transparent 50%,
            rgba(0, 255, 234, 0.03) 51%,
            transparent 52%
    );
    background-size: 100% 4px;
    animation: scanline 2s linear infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* 头部样式 */
.dashboard-header {
    position: relative;
    padding: 2rem;
    text-align: center;
    border-bottom: 2px solid #00ffea;
    margin-bottom: 2rem;
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 30px rgba(0, 255, 234, 0.3);
    z-index: 10;
}

.header-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(0, 255, 234, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.dashboard-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.title-text {
    text-shadow: 0 0 10px #00ffea, 0 0 20px #00ffea, 0 0 30px #00ffea;
    animation: textGlow 2s ease-in-out infinite alternate;
}

.title-pulse {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: #00ffea;
    box-shadow: 0 0 10px #00ffea;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes textGlow {
    0% { text-shadow: 0 0 10px #00ffea, 0 0 20px #00ffea, 0 0 30px #00ffea; }
    100% { text-shadow: 0 0 15px #00ffea, 0 0 25px #00ffea, 0 0 35px #00ffea, 0 0 45px #00ffea; }
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; width: 100px; }
    50% { opacity: 1; width: 150px; }
}

.app-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    font-size: 0.9rem;
}

.app-id {
    color: #00ffea;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff4444;
    box-shadow: 0 0 10px #ff4444;
}

.pulse-dot.active {
    background: #00ff44;
    box-shadow: 0 0 10px #00ff44;
    animation: dotPulse 1s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.5); }
}

/* 赛博卡片样式 */
.cyber-card {
    position: relative;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ffea;
    border-radius: 0;
    padding: 1.5rem;
    margin: 1.5rem;
    box-shadow: 0 0 20px rgba(0, 255, 234, 0.2);
    transition: all 0.3s ease;
    z-index: 5;
    transform: translate3d(0, 0, 0);
}

.cyber-card:hover {
    box-shadow: 0 0 30px rgba(0, 255, 234, 0.4);
    transform: translateY(-2px);
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(0, 255, 234, 0.1) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cyber-card:hover .card-glow {
    opacity: 1;
}

/* 区域头部 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 255, 234, 0.3);
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon {
    font-size: 1.4rem;
}

.cyber-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #00ffea, transparent);
    margin: 0 1rem;
}

/* 控制区域样式 */
.embedding-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.control-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.cyber-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-label {
    font-size: 0.9rem;
    color: #00ffea;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 输入控件样式 */
.cyber-input, .cyber-select {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #00ffea;
    color: #00ffea;
    padding: 0.75rem;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
    outline: none;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.cyber-input:focus, .cyber-select:focus {
    box-shadow: 0 0 10px rgba(0, 255, 234, 0.5);
    border-color: #00ffff;
}

.cyber-input::placeholder {
    color: rgba(0, 255, 234, 0.5);
}

/* 按钮样式 */
.cyber-button {
    position: relative;
    background: transparent;
    border: 1px solid #00ffea;
    color: #00ffea;
    padding: 0.75rem 1.5rem;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    outline: none;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.cyber-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 234, 0.2), transparent);
    transition: left 0.5s ease;
}

.cyber-button:hover::before {
    left: 100%;
}

.cyber-button:hover {
    box-shadow: 0 0 15px rgba(0, 255, 234, 0.5);
    background: rgba(0, 255, 234, 0.1);
}

.cyber-button.primary {
    border-color: #00ffea;
    color: #00ffea;
}

.cyber-button.secondary {
    border-color: #ff00ff;
    color: #ff00ff;
}

.cyber-button.danger {
    border-color: #ff4444;
    color: #ff4444;
}

.cyber-button.small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.cyber-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cyber-button:disabled:hover {
    box-shadow: none;
    background: transparent;
}

.button-content {
    position: relative;
    z-index: 2;
}

.button-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    background: rgba(0, 255, 234, 0.3);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.cyber-button:hover .button-glow {
    width: 100px;
    height: 100px;
}

/* 状态显示 */
.action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-light {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff4444;
    box-shadow: 0 0 10px #ff4444;
}

.status-light.idle { background: #ff4444; box-shadow: 0 0 10px #ff4444; }
.status-light.processing {
    background: #ffff00;
    box-shadow: 0 0 10px #ffff00;
    animation: processingPulse 1s ease-in-out infinite;
}
.status-light.success { background: #00ff44; box-shadow: 0 0 10px #00ff44; }

@keyframes processingPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.status-text {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 词云区域样式 */
.projector-container {
    position: relative;
    margin-top: 1rem;
}

.projector-beam {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 0;
    background: linear-gradient(to bottom, transparent, #00ffea, transparent);
    box-shadow: 0 0 20px #00ffea;
    transition: height 1s ease;
    z-index: 2;
}

.projector-beam.active {
    height: 40px;
}

.wordcloud-display {
    position: relative;
    height: 450px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(0, 255, 234, 0.3);
    opacity: 0;
    transform: scale(0.8);
    transition: all 1s ease;
}

.wordcloud-display.projecting {
    opacity: 1;
    transform: scale(1);
}

.wordcloud-canvas {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    z-index: 10;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 255, 234, 0.3);
    border-top: 3px solid #00ffea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #00ffea;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* 模态框样式 - 修复版本 */
.cyber-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: modalFadeIn 0.3s ease;
    backdrop-filter: blur(5px);
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cyber-modal {
    /*transform: translate(0, -50%);*/
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.95) 0%, rgba(26, 26, 46, 0.95) 100%);
    border: 2px solid #00ffea;
    box-shadow:
            0 0 30px rgba(0, 255, 234, 0.5),
            inset 0 0 30px rgba(0, 255, 234, 0.1);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    position: relative;
    animation: modalScaleIn 0.3s ease;
    overflow: hidden;
}

@keyframes modalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 255, 234, 0.3);
    background: rgba(0, 0, 0, 0.6);
    position: relative;
}

.modal-header h3 {
    color: #00ffea;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1.1rem;
    margin: 0;
}

.cyber-close-button {
    background: transparent;
    border: 1px solid #ff4444;
    color: #ff4444;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    position: relative;
    z-index: 10000;
}

.cyber-close-button:hover {
    background: rgba(255, 68, 68, 0.1);
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.5);
    transform: scale(1.1);
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* 问题列表样式 */
.questions-scroll {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.questions-scroll::-webkit-scrollbar {
    width: 6px;
}

.questions-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.questions-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 234, 0.5);
    border-radius: 3px;
}

.questions-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 234, 0.7);
}

.question-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 255, 234, 0.1);
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.3);
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.question-item:hover {
    background: rgba(0, 255, 234, 0.05);
    border-left: 2px solid #00ffea;
}

.question-index {
    color: #ff00ff;
    font-weight: bold;
    min-width: 30px;
    font-size: 0.9rem;
}

.question-text {
    color: #e0e0e0;
    flex: 1;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* 表单样式 */
.cyber-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    color: #00ffea;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    font-weight: 600;
}

.confirm-button {
    margin-top: 0.5rem;
    align-self: flex-start;
}

/* 任务列表样式 */
.tasks-container {
    margin-top: 1rem;
}

.tasks-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 234, 0.2);
}

/* 复选框样式 */
.cyber-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    position: relative;
}

.cyber-checkbox.small {
    transform: scale(0.8);
}

.checkbox-input {
    opacity: 0;
    position: absolute;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 1px solid #00ffea;
    background: rgba(0, 0, 0, 0.6);
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-input:checked + .checkmark {
    background: rgba(0, 255, 234, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 234, 0.5);
}

.checkbox-input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00ffea;
    font-weight: bold;
}

.checkbox-label {
    color: #00ffea;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

/* 任务网格样式 */
.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.task-card {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(0, 255, 234, 0.3);
    padding: 1rem;
    transition: all 0.3s ease;
    display: flex;
    gap: 1rem;
    position: relative;
}

.task-card:hover {
    border-color: #00ffea;
    box-shadow: 0 0 15px rgba(0, 255, 234, 0.3);
    transform: translateY(-2px);
}

.task-card.selected {
    border-color: #ff00ff;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.4);
    background: rgba(255, 0, 255, 0.05);
}

.task-selector {
    display: flex;
    align-items: flex-start;
}

.task-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-id {
    color: #00ffea;
    font-weight: bold;
    font-size: 0.9rem;
}

.task-model {
    color: #ff00ff;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.task-description {
    color: #ffffff;
    font-size: 0.9rem;
    line-height: 1.4;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: rgba(0, 255, 234, 0.7);
}

.task-actions {
    display: flex;
    align-items: flex-start;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 234, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 234, 0.7);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .dashboard-title {
        font-size: 1.8rem;
    }

    .control-grid {
        grid-template-columns: 1fr;
    }

    .tasks-grid {
        grid-template-columns: 1fr;
    }

    .action-row {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .cyber-modal {
        width: 95%;
        margin: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-header h3 {
        font-size: 1rem;
    }
}